//导入request.js请求工具
import request from '@/utils/request.js'

export const getGoodsService = (page, pageSize, search) => {
    return request({
        url: '/goods/getGoods',
        method: 'get',
        params: {
            page,
            pageSize,
            search
        }
    })
}

//发布
export const pushGoodsService = (data) => {
    return request({
        url: '/goods',
        method: 'post',
        data
    })
}


export const getRecommendGoodsService = () => {
    return request({
        url: '/goods/recommendGoods',
        method: 'get'
    })
}

export const getHotTopGoodsService = () => {
    return request({
        url: '/goods/getGoodsHotTop',
        method: 'get'
    })
}

export const incrementLookedNumService = (goodsId) => {
    return request({
        url: `/goods/incrementLookedNum/${goodsId}`,
        method: 'patch'
    })
}

export const getMyPushGoodsService = (page, pageSize) => {
    return request({
        url: '/goods/getMyPushGoods',
        method: 'get',
        params: {
            page,
            pageSize
        }
    })
}

export const deletedGoodsService = (ids)=>{
    return request({
        url: `/goods/${ids}`,
        method: 'delete'
    })
}

export const getGuessYouLikeService = () => {
    return request({
        url: `/goods/guessLike`,
        method: 'get'
    })
}